{{ extend '../_layouts/home.html' }}

{{ block 'title' }}{{ '多人博客 - 个人主页' }}{{ /block }}

{{ block 'body' }} 
<section class="container">
    {{ include '../_partials/setting-avatar.html' }}
    <div class="col-md-9">
        <div class="list-container">
            <ul class="list-tab">
                <li><a href="/settings/profile" class="active">个人主页</a></li>
                <li><a href="/myFollow">关注</a></li>
                <li><a href="/myFans">粉丝</a></li>
                <li><a href="/myCollection">收藏</a></li>
                <li><a href="/settings/admin">修改密码</a></li>
                <li><a href="/settings/createdTopics">已创建话题</a></li>
                <li><a href="/settings/partTopics">已参与话题</a></li>
            </ul>    
        </div>
        <form class="form-horizontal" id="profile_user" action="/settings/profile" method="post">
            <input type="hidden" value="{{ user._id }}" name="id">
            <div class="form-group">
                <label for="email" class="col-sm-2 control-label">邮箱</label>
                <div class="col-sm-9">
                    <p class="form-control-static">{{ user.email }}</p>
                </div>
            </div>
            <div class="form-group">
                <label for="created_time" class="col-sm-2 control-label">创建时间</label>
                <div class="col-sm-9">
                    <p class="form-control-static">{{ dateFormat(user.created_time)  }}</p>
                </div>
            </div>
            <div class="form-group">
                <label for="nickname" class="col-sm-2 control-label">昵称</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" id="nickname" placeholder="" name="nickname" value="{{ user.nickname }}">
                </div>
            </div>
            <div class="form-group">
                <label for="gender" class="col-sm-2 control-label">性别</label>
                <div class="col-sm-9">
                    <p class="myHide" style="display: none;">{{ user.gender }}</p>
                    <select class="form-control" id="selectMe" name="gender">
                        <option value="0">男</option>
                        <option value="1">女</option>
                        <option value="-1">保密</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="birthday" class="col-sm-2 control-label">生日</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" id="birthday" placeholder="" name="birthday" value="{{ datetimeFormat(user.birthday) }}">
                </div>
            </div>
            <div class="form-group">
                <label for="bio" class="col-sm-2 control-label">个人简介</label>
                <div class="col-sm-9">
                    <textarea class="form-control" rows="3" name="bio" value="{{ user.bio }}">{{ user.bio }}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label for="bio" class="col-sm-2 control-label"></label>
                <div class="col-sm-8">
                    <button type="submit" class="btn btn-success">修改</button>
                </div>
            </div>
        </form>
    </div>
</section>
{{ /block }}
{{block 'script'}}
<script>
$(function(){
    // 下拉框选中值
    var myHide = $('.myHide').text()
    $("#selectMe").find("option[value='"+ myHide +"']").attr("selected",true);
    
})

</script>
{{/block}}